package org.zcl.exception;

import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.zcl.enums.ResultCode;

/**
 * 业务异常
 *
 * @author zhuchenglin
 * @date 2022/09/07 14:17
 */
@Getter
@Setter
@Slf4j
public class BusinessException extends BaseException {
    /**
     * 串行版本uid
     */
    private static final long serialVersionUID = -1944432773455806433L;

    /**
     * 业务异常
     *
     * @param code 代码
     */
    public BusinessException(ResultCode code) {
        super(code.getCode(), code.getDesc());
    }

    /**
     * 业务异常
     *
     * @param code    代码
     * @param message 消息
     */
    public BusinessException(String code, String message) {
        super(code, message);
    }

    /**
     * 业务异常
     *
     * @param message 消息
     */
    public BusinessException(String message) {
        super("-1", message);
    }
}


